package com.example.service_aidl_server

import android.app.Service
import android.content.Intent
import android.os.IBinder
import android.util.Log

class CarService : Service() {
    val binder:IBinder = object :ICarAidlInterface.Stub(){
        override fun getCurrentSpeed(): Int {

            return 10
        }

        override fun getCurrentSpeed2(callback: ICarCallback?) {
            //异步回调
            Thread{
                Thread.sleep(8000)
                callback?.onCarSpeed(20)

            }.start()
        }

        override fun addStudentBeanOut(bean: StudentBean?) {

        }


    }

    override fun onBind(intent: Intent): IBinder {
       return binder
    }
}